import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;

public  class  Readfile {



    public static void fileRead() throws Exception{
        File file = new File("D:\\01.txt");
        FileReader reader = new FileReader(file);
        BufferedReader bufferedReader = new BufferedReader(reader);
        StringBuffer stringBuffer = new StringBuffer();
        String s = "";
        while ((s = bufferedReader.readLine())!=null){
            stringBuffer.append(s+"\n");
            System.out.println(s);
        }
        bufferedReader.close();
        String str = stringBuffer.toString();
        System.out.println(str);

    }
    public static void main(String[] args) throws Exception {
            fileRead();
    }
}
